﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
namespace IHISCETeim.Web.AgentSys.VipMgr
{
    public partial class VIPExchangePartEdit : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.修改 };
            }
        }

        protected override string DWZRef
        {
            get { return "VIPExchangePartList"; }
        }


        protected int ID { get { return GetRequestValue<int>("ID",0); } }

        private VIPExchangePartInfo _obj;
        protected VIPExchangePartInfo obj
        { 
            get
            {
                if(_obj==null)
                {
                    _obj=VIPExchangePartController.GetList(ID);
                }
                return _obj;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "edit")
            {
                addmenu();

            }
        }

        protected void addmenu()
        {
            VIPExchangePartInfo obj2 = Request.SerializableObject<VIPExchangePartInfo>();
            // obj.UserType = 1;

            bool r = VIPExchangePartController.Update(obj2);

            // this.AddLog(Permission.新增, null, obj);
             if (r )
            {
                SuccessJson("修改成功", this.DWZRef);
            }
            else
            {
                ErrorJson("修改失败", this.DWZRef);
            }
        }
    }
}